package com.atguigu.yygh.task.tasks;

import cn.hutool.core.date.DateUtil;
import com.atguigu.yygh.common.component.MsmSender;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author 孔德成
 * @slogan 致敬大师，致敬未来的你
 * @date 2021/9/15 9:06 下午
 * @desc
 */
@Component
@Slf4j
public class ScheduledTask {
    @Autowired
    private MsmSender msmSender;

    /**
     * 每天8点执行 提醒就诊
     */
    //@Scheduled(cron = "0 0 8 * * ?")
    @Scheduled(cron = "0/50 * * * * ?")
    public void remindUsers() {
        log.info(DateUtil.today());
        msmSender.sendToPatient("就诊提醒");
    }
}
